package com.koron.operation.classes.form.service;


import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.koron.bean.query.PageQuery;
import com.koron.operation.classes.form.bean.dto.ClassesFormChangeDTO;
import com.koron.operation.classes.form.bean.po.ClassesFormChange;
import com.koron.operation.classes.form.bean.vo.ClassesFormChangeVO;
import org.koron.ebs.mybatis.SessionFactory;

import java.util.List;

/**
 * 班别调整表(ClassesFormChange)表服务接口
 *
 * @author jzp
 * @since 2023-05-22 09:48:16
 */
public interface ClassesFormChangeService {

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    ClassesFormChangeVO getVoById(SessionFactory factory, String id);

    ClassesFormChangeVO getVoByShiftId(SessionFactory factory, String shiftId);

    List<ClassesFormChangeVO> listByFormId(SessionFactory factory, String formId);

    ClassesFormChangeDTO getDtoById(SessionFactory factory, String id);

    ClassesFormChangeDTO getDtoByShiftId(SessionFactory factory, String shiftId);


    /**
     * 查询所有数据
     *
     * @param classesFormChange 查询条件对象
     * @return 列表结果集
     */
    List<ClassesFormChangeVO> list(SessionFactory factory, ClassesFormChange classesFormChange);

    List<ClassesFormChangeDTO> listDetail(SessionFactory factory, ClassesFormChange classesFormChange);

    /**
     * 分页查询
     *
     * @param classesFormChange 分页条件
     * @return 对象列表
     */
    default PageInfo<ClassesFormChangeVO> page(SessionFactory factory, PageQuery pageQuery, ClassesFormChange classesFormChange) {
        PageHelper.startPage(pageQuery.getPage(), pageQuery.getPageSize(), pageQuery.getOrderBy());
        List<ClassesFormChangeVO> classesFormChangeList = list(factory, classesFormChange);
        return new PageInfo<>(classesFormChangeList);
    }

    /**
     * 新增数据
     *
     * @param classesFormChange 实例对象
     * @return 是否成功
     */
    boolean save(SessionFactory factory, ClassesFormChange classesFormChange);

    boolean saveDto(SessionFactory factory, ClassesFormChangeDTO classesFormChangeDTO);

    /**
     * 修改数据
     *
     * @param classesFormChange 实例对象
     * @return 是否成功
     */
    boolean update(SessionFactory factory, ClassesFormChange classesFormChange);

    boolean updateStatus(SessionFactory factory, String id, String status);

    boolean submit(SessionFactory factory, ClassesFormChangeDTO classesFormChangeDTO, String currNodeCode);

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     * @return 是否成功
     */
    boolean deleteById(SessionFactory factory, String id);

}
